package com.example.demo.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.common.JsonResult;
import com.example.demo.dto.LoginRequestDto;
import com.example.demo.dto.LoginResponseDto;
import com.example.demo.service.LoginService;

/**
 * ログイン Controller
 */
@RestController
public class LoginController {

	@Resource
	private LoginService loginService;
	
	// git test 

	/**
	 * ログイン
	 * 
	 * @param requestDto ログイン用Request DTO
	 * @return JsonResult
	 */
	@RequestMapping(value = "/bff/login", method = RequestMethod.POST)
	public JsonResult login(@RequestBody LoginRequestDto requestDto) {
		LoginResponseDto responseDto = loginService.login(requestDto);
		return JsonResult.success(responseDto);
	}
}